(: Ex3 :)

<Southernmost_city_in_continental_France>
{
(: 
   opening xml database mondial-europe
   getting country node having attribute car_code equals to F
   getting pronvince nodes which don't have a name child node equals to Corse
   getting city node
:)
  let $f := doc('/db/mondial/mondial-europe.xml')/mondial/country[@car_code='F']/province[name!='Corse']/city
(: 
  getting city having the minimum latitude in the subset of cities we retrieved before
:)
  for $c in $f[latitude =min($f/latitude)]
(:
   construct a city node have two child node corresponding to
   the name of the city
   the latitude of the city
:)
     return <city> {$c/name}
                   {$c/latitude}
            </city>
}
</Southernmost_city_in_continental_France>
